import fetch from "common/src/utils/fetch";

/**
 *  排考
 */
function arrangeExam(data) {
  return fetch({
    url: "/api/electionservice/fxCollegeExamArrange/arrangeExam",
    method: "post",
    data
  });
}

/**
 *  手动排考校验课程组是否有相同学生或者多个教学班有相同学生，否则提示不能安排同一个时间
 */
function manualSchoolExamCheek(data) {
  return fetch({
    url: "/api/electionservice/fxCollegeExamArrange/manualSchoolExamCheek",
    method: "post",
    data
  });
}

/**
 *  删除考试
 */
function delExam(data) {
  return fetch({
    url: "/api/electionservice/fxCollegeExamArrange/delExam",
    method: "post",
    data
  });
}

/**
 * 根据开始时间结束时间查询当前时间位于哪个学期，第几周，周几，所在节次
 */
function dayAndWorkTime(beginTime, endTime) {
  return fetch({
    url:
      `/api/baseresservice/schoolCalendar/dayAndWorkTime?beginTime=` +
      beginTime +
      `&endTime=` +
      endTime,
    method: "get"
  });
}

/**
 * 获取 key
 */
function getResultByKey(key) {
  return fetch({
    url: "/api/electionservice/fxCollegeExamArrange/result/" + key,
    method: "get"
  });
}

/**
 * 获取 key
 */
function getProcessResult(key) {
  return fetch({
    url: "/api/electionservice/fxCollegeExamArrange/getProcessResult/" + key,
    method: "get"
  });
}



/**
 *  添加备注
 */
function addRemark(data) {
  return fetch({
    url: "/api/electionservice/fxCollegeExamArrange/addRemark",
    method: "post",
    data
  });
}

/**
 *  导出
 */
function exportExamInfo(data) {
  return fetch({
    url: "/api/electionservice/fxCollegeExamArrange/exportExamInfo",
    method: "post",
    data
  });
}

const pageUrl = "/api/electionservice/fxCollegeExamArrange/getArrangeCourseList";

export default {
  arrangeExam: arrangeExam,
  delExam: delExam,
  dayAndWorkTime: dayAndWorkTime,
  addRemark: addRemark,
  manualSchoolExamCheek: manualSchoolExamCheek,
  pageUrl: pageUrl,
  exportExamInfo:exportExamInfo,
  getProcessResult:getProcessResult,
  getResultByKey: getResultByKey
};
